from extension import db  # 防止循环引用


class Notice(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(255), nullable=True, comment='名称')
    content = db.Column(db.String(255), nullable=True, comment='内容')
    time = db.Column(db.String(255), nullable=True, comment='时间')

    def to_dict(self):
        return {
            'id': self.id,
            'name': self.name,
            'content': self.content,
            'time': self.time
        }
